import actory,random

class Game(actory.World):
	"A Game is World where sometimes we bored with playing a game."
	def __init__(self):
		super(Game,self).__init__()
	def bored(self):
		return self.steps > 5
	def yawn(self):
		print "I'm outta here."

def eg1() :
	"Demo"
	m = actory.Easy("""
  #whitesTurn|        |       |white moves|#blacksTurn*10
             |        |       |checkmate  |blackWins.
             |?bored()|?yawn()|stalemate  |draw.

  #blacksTurn|||black moves|#whitesTurn*10
            |?bored||stalemate  |draw.
            |||checkmate  |whiteWins.
  """)
	for i in range(10):
		print i
		m.run(Game())

if __name__ == "__main__":
	random.seed(1)
	eg1()
